<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Purchase/index')}">列表</a></li>
        <li><a href="{:url('Purchase/index')}">返回</a></li>
    </ul>

    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th>ID</th>
            <th>订单号</th>
            <th>类别</th>
            <th>牌号</th>
            <th>钢卷号</th>
            <th>厚</th>
            <th>宽</th>
            <th>长</th>
            <th>数量</th>
            <th>吨重</th>
            <th>到货数量</th>
            <th>到货重量</th>
            <th>差额</th>
            <th>单价</th>

            <th>采购钢厂</th>
            <th>交货月</th>
            <th>到货地点</th>
            <th width="150">操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="lists['data']" item="vo">
            <tr>
                <td>
                    {$vo['id']}
                </td>
                <td>
                    {$vo['order_id']}
                </td>
                <td>
                    {$vo['c_name']}
                </td>
                <td>
                    {$grade_id_arr[$vo['grade_id']]|default=''}
                    {$vo['steel_grade_id']}
                </td>
                <td>
                    {$vo['coil_num']}
                </td>
                <td>
                    {$vo['d']}
                </td>
                <td>
                    {$vo['w']}
                </td>
                <td>
                    {$vo['h']}
                </td>
                <td>
                    {$vo['num']}
                </td>
                <td>
                    {$vo['weight']}
                </td>
                <td>
                    {$vo['arr_num']}
                </td>
                <td>
                    {$vo['arr_weight']}
                </td>
                <td>
                    {$vo['differ']}
                </td>
                <td>
                    {$vo['unit_price']}
                </td>

                <td>
                    {$vo['steelmill']}
                </td>
                <td>
                    {$vo['delivery_month']}
                </td>
                <td>
                    {$vo['arr_place']}
                </td>
                <td>
                    <a class="btn btn-xs btn-primary" href="{:url('Purchasesub/edit',['id'=>$vo['id']])}">编辑</a>
                    <a class="btn btn-xs btn-danger js-ajax-dialog-btn" data-msg="确定推送入库吗？"
                       href="{:url('Purchasesub/push',['id'=>$vo['id']])}">推送入库</a>
                    <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Purchasesub/del',['id'=>$vo['id']])}">删除</a>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination">{$page}</div>
</div>
<script src="/static/js/admin.js"></script>
<script src="/static/js/layer/layer.js"></script>
<script>
    function see(obj) {
        layer.open({
            content: $(obj).text().trim()
        });
    }

    function detail(id, field) {
        $.ajax({
            url: '{:url('Purchasesub / field
        ')}?id=' + id + '&field=' + field,
            type
    :
        'get',
            success(res)
        {
            if (res.code == 1) {
                let tpl = '';
                for (const item of res.data) {
                    tpl += `<p>地址：<input value="${item}" readonly class="form-control" style="width:80%;display: inline-block;" type="text">&nbsp;<a target="_blank" href="{$domain}${item}" class="btn btn-success">跳转</a></p>`;
                }
                layer.open({
                    area: ['60%', '100%'],
                    content: tpl
                });
            } else {
                layer.msg('查看失败');
            }
        }
    })
        ;
    }
</script>
</body>
</html>
</body>
</html>
